package com.txts.road.app.event.controller;

import com.txts.road.app.event.model.vo.EventNewsVO;
import com.txts.road.app.event.service.EventNewsService;

import com.txts.base.common.domain.ResponseDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.txts.road.app.event.model.query.EventNewsQuery;

import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * 赛事新闻前端控制层
 *
 * @author baoyr
 * @since 2025-07-17 10:47
 */
@Tag(name = "赛事新闻接口")
@RestController
@RequestMapping("/api/v1/event-news")
@RequiredArgsConstructor
public class EventNewsController  {
    private final EventNewsService eventNewsService;
    /**
     * 获取新闻列表
     *
     * @param query 查询条件
     * @return 分页的新闻列表
     */
    @Operation(summary = "获取新闻列表")
    @PostMapping("/news/list")
    public ResponseDTO<List<EventNewsVO>> getNewsList(@RequestBody EventNewsQuery query) {
        return ResponseDTO.ok(eventNewsService.getNewsList(query));
    }

}
